home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 13aug 1997
- // Author: ks
- //
- //
-
- global proc blendShapeMenuCmd( string $editorName, string $itemName )
- //
- // Procedure Name:
- // blendShapeMenuCmd
- //
- // Description:
- // Command attached to menu items in the blend shape editor
- //
- // Input Arguments:
- // string $editorName - name of the editor
- // string $itemName - name of the menu item calling the proc
- //
- // Return Value:
- // None.
- //
- {
- string $itemCmd;
- string $msg;
- int $error = false;
-
- int $querVal = `blendShapeEditor -q -vs $editorName`;
- int $setVal = $querVal;
- if($itemName == "bseMIHoriz") {
- $setVal = 0;
- } else if ($itemName == "bseMIVertical") {
- $setVal = 1;
- }
-
- if ($setVal != $querVal) {
- $itemCmd = "blendShapeEditor -e -vs " + $setVal + " " + $editorName;
- evalEcho $itemCmd;
- }
- }
-
- global proc buildBlendShapeContextHelpItems(string $nameRoot, string $menuParent)
- //
- // Description:
- // Build context sensitive menu items
- //
- // Input Arguments:
- // $nameRoot - name to use as the root of all item names
- // $menuParent - the name of the parent of this menu
- //
- // Return Value:
- // None
- //
- {
- menuItem -label "Help on Editing Blend Shapes..."
- -enableCommandRepeat false
- -command "showHelp EditBlendShape";
- }
-
-
- global proc createBlendShapePanelMenu( string $panel )
- //
- // Procedure Name:
- // createBlendShapePanelMenu
- //
- // Description:
- // Create a new blendShape panel with the menu bar
- //
- // Input Arguments:
- // string $panel - the name of the panel
- //
- // Return Value:
- // None.
- //
- {
- // if this menu has already been built, return
- //
- {
- string $panelControl = `panel -q -control $panel`;
- if ( `menuBarLayout -exists $panelControl` ){
- string $ma[] = `menuBarLayout -q -menuArray $panelControl`;
- for ( $name in $ma ){
- if ( $name == "Panels" ) {
- return;
- }
- if ( $name == ($panel+"EditMenu")) {
- return;
- }
- }
- setParent $panelControl;
- }
- }
-
- // Add support for the Context Sensitive Help Menu.
- //
- addContextHelpProc $panel "buildBlendShapeContextHelpItems";
-
- // By the time we get here, we know the menu bar
- // of the blendShapePanel is the current menu bar
- //
- // Get the name of the blendShape editor in this panel
- //
- string $ed = `blendShapePanel -q -blendShapeEditor $panel`;
- string $itemName = `menu -tearOff true -l "Edit" ($panel+"EditMenu")`;
- string $itemCmd = ("blendShapeMenuCmd " + $ed);
- menuItem -l "Create BlendShape"
- -ann "Make a new blendShape target set for the selected base shape"
- -c "blendShape -par"
- bseMINew;
-
- menuItem -l "Deselect All"
- -ann "Deselect All"
- -c "select -clear"
- bseMIDeselect;
-
- $itemName = `menu -tearOff true -l "Options" ($panel+"OptionsMenu")`;
-
- menuItem -l "Orientation" -subMenu true
- -ann "Toggle the sliders between vertical and horizontal configuration";
-
- radioMenuItemCollection ($panel + "_BlendShapeSliderTypes_");
-
- menuItem -rb 1 -l "Vertical"
- -c ($itemCmd + " bseMIVertical")
- bseMIVertical;
-
- menuItem -rb 1 -l "Horizontal"
- -c ($itemCmd + " bseMIHoriz")
- bseMIHoriz;
-
- int $querVal = `blendShapeEditor -q -vs $ed`;
- if($querVal) {
- menuItem -e -rb 1 bseMIVertical;
- } else {
- menuItem -e -rb 1 bseMIHoriz;
- }
- setParent -menu ..;
-
- buildPanelPopupMenu( $panel );
-
- }
-
-
-
-
-
-
-